From 6a5d555f58f1492383e52e34aa5748f3a2ca9bc1 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 26 Jul 2021 02:28:49 +0200 Subject: [PATCH] contentformats: Change the format of gdk_content_formats_to_string() Now, we just print a whitespace-separated list of GTypes and mime types. This makes this neat for 2 things: 1. Parsing it (see next commit) 2. Using it in GtkBuilder (see commits after that) In particular, the common case of supporting a single GType (or mime type) looks like just printing the GType (or mime type), which in GtkBuilder looks like GdkTexture --- gdk/gdkcontentformats.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gdk/gdkcontentformats.c b/gdk/gdkcontentformats.c index aa0541bd44..24ac00ad14 100644 --- a/gdk/gdkcontentformats.c +++ b/gdk/gdkcontentformats.c @@ -241,20 +241,18 @@ gdk_content_formats_print (GdkContentFormats *formats, g_return_if_fail (formats != NULL); g_return_if_fail (string != NULL); - g_string_append (string, "{ "); for (i = 0; i < formats->n_gtypes; i++) { if (i > 0) - g_string_append (string, ", "); + g_string_append (string, " "); g_string_append (string, g_type_name (formats->gtypes[i])); } for (i = 0; i < formats->n_mime_types; i++) { if (i > 0 || formats->n_gtypes > 0) - g_string_append (string, ", "); + g_string_append (string, " "); g_string_append (string, formats->mime_types[i]); } - g_string_append (string, " }"); } /** -- 2.30.2